package cn.iocoder.yudao.module.yyzx.service.outgoing.mysql.staff;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.yyzx.dal.dataobject.staff.StaffDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.yyzx.controller.admin.staff.vo.*;

/**
 * 员工 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface StaffMapper extends BaseMapperX<StaffDO> {

    default PageResult<StaffDO> selectPage(StaffPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<StaffDO>()
                .likeIfPresent(StaffDO::getStaffName, reqVO.getStaffName())
                .eqIfPresent(StaffDO::getStaffSex, reqVO.getStaffSex())
                .eqIfPresent(StaffDO::getStaffNumber, reqVO.getStaffNumber())
                .eqIfPresent(StaffDO::getStaffType, reqVO.getStaffType())
                .eqIfPresent(StaffDO::getDuty, reqVO.getDuty())
                .eqIfPresent(StaffDO::getPositionalTitle, reqVO.getPositionalTitle())
                .eqIfPresent(StaffDO::getStaffStatus, reqVO.getStaffStatus())
                .eqIfPresent(StaffDO::getPhoneNumber, reqVO.getPhoneNumber())
                .betweenIfPresent(StaffDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(StaffDO::getId));
    }

}